find the 2nd largest element in an array